package com.demo.controller;

import com.demo.pojo.User;
import com.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 绛河
 * @date 2023/4/23
 * @apiNote
 */
@RestController
public class FirstController {
    @Autowired
    private UserService userService;
    @RequestMapping("/first")
    public String first(){
        return "Hello SpringBoot";
    }

    @RequestMapping("/all")
    public List<User> all(){
        List<User> users = userService.queryUsers();
        return users;
    }

}
